package cn.zb.user;

import com.jfinal.plugin.activerecord.Model;

/**
 * Created by Yang on 2015/3/10.
 */
public class User extends Model<User> {

    public static final User me = new User();

    /**
     * 根据openId获取用户
     * @param openId
     * @return
     */
    public User findByOpenId(String openId, String thirdName) {
        String sql = "select * from zb_user where openid = ? and third_name = ?";
        User user = findFirst(sql, openId, thirdName);
        return user;
    }
}
